<template>
  <view>
    <view v-if="type == 1" class="payBox">
      <view class="titleBox">
        <img alt=""
             class="payImg"
             src="https://hzdaoziji.oss-cn-hangzhou.aliyuncs.com/file177f2a286d9441699dbd919864c5cd2b.png">
        <view class="payTitle">
          支付成功
        </view>
      </view>
      <view v-if="orderType == 1" class="">
        <view v-if="lineType == 1 || lineType == 4" class="">
          <view class="payText">
            报名成功
          </view>
          <view class="payText">
            请留意供应商电话与您联系
          </view>
        </view>
        <view v-if="lineType == 2" class="">
          <view class="payText">
            待成团,请留意供应商电话
          </view>
          <view class="payText">
            报名时间截止后未成团系统会自动退款
          </view>
        </view>
        <view v-if="lineType == 3" class="">
          <view class="payText">
            报名成功
          </view>
        </view>
        <view v-if="lineType == 5" class="">
          <view class="payText">
            报名成功
          </view>
        </view>
      </view>

      <view v-if="orderType == 2" class="">
        <view class="payText">
          下单成功,可在订单列表核销
        </view>
      </view>

      <view v-if="orderType == 1" class="buttonBox" @click="buttonClick('/pages/tourplan/index')">
        旅程计划
      </view>
      <view v-if="orderType == 2" class="buttonBox" @click="orderClick('/pages/tourplan/index')">
        订单列表
      </view>
      <view class="buttonBox buttonOne" @click="buttonClick('/pages/home/index')">
        返回首页
      </view>
    </view>

    <view v-if="type == 2" class="payBox">
      <view class="titleBox">
        <img alt=""
             class="payImg"
             src="https://hzdaoziji.oss-cn-hangzhou.aliyuncs.com/file2d8d9574d7c544b2867ab65d7f1cf490.png">
        <view class="payTitle">
          取消支付
        </view>
      </view>
      <view class="payText">
        可在订单列表继续支付
      </view>

      <view class="buttonBox" @click="orderClick('/pages/tourplan/index')">
        订单列表
      </view>
      <view class="buttonBox buttonOne" @click="buttonClick('/pages/home/index')">
        返回首页
      </view>
    </view>

  </view>
</template>

<script>
export default {
  data() {
    return {
      type: "",
      lineType: "",
      orderType: ""
    }
  },
  onLoad(data) {
    console.log('输出支付状态', data);
    this.type = data.type
    this.lineType = data.lineType
    this.orderType = data.orderType
  },
  methods: {
    buttonClick(data) {
      console.log(data);
      uni.switchTab({
        url: data
      });
    },
    orderClick() {
      uni.navigateTo({
        url: "/pages/my/orderList/orderList?type=''"
      });
    },
  }
}
</script>

<style lang="scss" scoped>
.payBox {
  .titleBox {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 200rpx;

    .payImg {
      width: 130rpx;
      height: 130rpx;
    }

    .payTitle {
      font-size: 90rpx;
      font-weight: 700;
      margin-left: 20rpx;
    }
  }

  .payText {
    color: #d9001b;
    width: 474rpx;
    margin: auto;
    font-size: 42rpx;
    font-weight: 700;
    padding: 20rpx 0;
    text-align: center;
  }

  .buttonBox {
    width: 474rpx;
    height: 90rpx;
    background-color: #f59a23;
    text-align: center;
    line-height: 90rpx;
    color: #fff;
    border-radius: 20rpx;
    margin: auto;
    margin-top: 20rpx;
    margin-bottom: 20rpx;
  }

  .buttonOne {
    background-color: #169bd5;
  }
}
</style>
